package com.kaver.sso.dao.service.impl;

import com.kaver.sso.dao.po.SsoRights;
import com.kaver.sso.dao.po.SsoRoleRights;
import com.kaver.sso.dao.mapper.SsoRoleRightsMapper;
import com.kaver.sso.dao.service.SsoRoleRightsDao;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

import org.springframework.stereotype.Service;

/**
 * <p>
 * 角色权限表 服务实现类
 * </p>
 *
 * @author roc
 * @since 2021-08-06
 */
@Service
public class SsoRoleRightsDaoImpl extends ServiceImpl<SsoRoleRightsMapper, SsoRoleRights> implements SsoRoleRightsDao {

	@Override
	public List<SsoRights> queryRoleRights(List<Long> roleIds) {
		return this.baseMapper.queryRoleRights(roleIds);
	}

	@Override
	public List<SsoRights> queryUserRights(String userId, Long groupId) {
		return this.baseMapper.queryUserRights(userId, groupId);
	}

	@Override
	public boolean queryUserHaveRight(String userId, Long groupId, String rightIdentifier) {
		int count = this.baseMapper.queryUserHaveRight(userId, groupId, rightIdentifier);
		return count > 0 ? true : false;
	}

}
